home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 API Bible / Windows 95 API Bible 3 Disc Set.iso / Win32 API Bible Book 3 of 3.iso / chapte11 / initia~1 / phone.c < prev    next >
C/C++ Source or Header  |  1996-04-28  |  18KB  |  557 lines

  1. #include <windows.h> 
  2. #include <windowsx.h> 
  3. #include "phone.h" 
  4. #include "tapi.h"
  5.  
  6. #define BUFSIZE 256
  7. #define APIHIVERSION     0x00010028    /* 1.40 */
  8. #define APILOWVERSION    0x00010000    /* 1.0 */
  9. #define EXTHIVERSION     0x00010005    /* 1.5 */
  10. #define EXTLOWVERSION    0x00000009    /* 0.9 */ 
  11. #define MAX_PHONE        2
  12. #define OWNER            0
  13. #define MONITOR            1
  14.  
  15.  
  16. #if defined (WIN32)
  17.     #define IS_WIN32 TRUE
  18. #else
  19.     #define IS_WIN32 FALSE
  20. #endif
  21.  
  22. #define IS_NT      IS_WIN32 && (BOOL)(GetVersion() < 0x80000000)
  23. #define IS_WIN32S  IS_WIN32 && (BOOL)(!(IS_NT) && (LOBYTE(LOWORD(GetVersion()))<4))
  24. #define IS_WIN95   (BOOL)(!(IS_NT) && !(IS_WIN32S)) && IS_WIN32
  25.  
  26. HINSTANCE hInst;   // current instance
  27. HWND hWnd;         // parent window handle
  28. HWND hListWnd;     // listbox
  29. HDC  hdc;
  30. TEXTMETRIC  tm ;
  31.  
  32.  
  33. LPCTSTR lpszAppName = "phoneInitialize";
  34. LPCTSTR lpszTitle   = "phoneInitialize"; 
  35.  
  36.  
  37. BOOL RegisterWin95( CONST WNDCLASS* lpwc );
  38.  
  39.  
  40. int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
  41.                       LPTSTR lpCmdLine, int nCmdShow)
  42. {
  43.    MSG      msg;
  44.    WNDCLASS wc;
  45.  
  46.    wc.style         = CS_HREDRAW | CS_VREDRAW;
  47.    wc.lpfnWndProc   = (WNDPROC)WndProc;       
  48.    wc.cbClsExtra    = 0;                      
  49.    wc.cbWndExtra    = 0;                      
  50.    wc.hInstance     = hInstance;              
  51.    wc.hIcon         = LoadIcon (hInstance, lpszAppName); 
  52.    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
  53.    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
  54.    wc.lpszMenuName  = lpszAppName;              
  55.    wc.lpszClassName = lpszAppName;              
  56.  
  57.    if ( IS_WIN95 )
  58.    {
  59.       if ( !RegisterWin95( &wc ) )
  60.          return( FALSE );
  61.    }
  62.    else if ( !RegisterClass( &wc ) )
  63.       return( FALSE );
  64.  
  65.    hInst = hInstance; 
  66.  
  67.    hWnd = CreateWindow( lpszAppName, 
  68.                         lpszTitle,    
  69.                         WS_OVERLAPPEDWINDOW, 
  70.                         CW_USEDEFAULT, 0, 
  71.                         CW_USEDEFAULT, 0,  
  72.                         NULL,              
  73.                         NULL,              
  74.                         hInstance,         
  75.                         NULL               
  76.                       );
  77.  
  78.    if ( !hWnd ) 
  79.       return( FALSE );
  80.  
  81.    ShowWindow( hWnd, nCmdShow ); 
  82.    UpdateWindow( hWnd );         
  83.  
  84.    while( GetMessage( &msg, NULL, 0, 0) )   
  85.    {
  86.       TranslateMessage( &msg ); 
  87.       DispatchMessage( &msg );  
  88.    }
  89.  
  90.    return( msg.wParam ); 
  91. }
  92.  
  93.  
  94. BOOL RegisterWin95( CONST WNDCLASS* lpwc )
  95. {
  96.     WNDCLASSEX wcex;
  97.  
  98.    wcex.style         = lpwc->style;
  99.    wcex.lpfnWndProc   = lpwc->lpfnWndProc;
  100.    wcex.cbClsExtra    = lpwc->cbClsExtra;
  101.    wcex.cbWndExtra    = lpwc->cbWndExtra;
  102.    wcex.hInstance     = lpwc->hInstance;
  103.    wcex.hIcon         = lpwc->hIcon;
  104.    wcex.hCursor       = lpwc->hCursor;
  105.    wcex.hbrBackground = lpwc->hbrBackground;
  106.    wcex.lpszMenuName  = lpwc->lpszMenuName;
  107.    wcex.lpszClassName = lpwc->lpszClassName;
  108.  
  109.    // Added elements for Windows 95.
  110.    //...............................
  111.    wcex.cbSize = sizeof(WNDCLASSEX);
  112.    wcex.hIconSm = LoadImage(wcex.hInstance, lpwc->lpszClassName, 
  113.                             IMAGE_ICON, 16, 16,
  114.                             LR_DEFAULTCOLOR );
  115.             
  116.    return RegisterClassEx( &wcex );
  117. }
  118.  
  119. typedef struct tagMYINFO    // general application information
  120. {
  121.     HPHONEAPP phoneApp;      // instance handle TAPI gives back to us                                                                              through phoneInitialize()
  122.     DWORD dwNumDevices;     // number of available devices
  123.     DWORD dwAPIVersion;     // API version the phone supports
  124.     DWORD dwExtVersion;        // extended version
  125. } MYINFO;
  126.  
  127. typedef struct tagPHONEINFO  // information on an open phone
  128. {
  129.    HPHONE     hPhone;           // handle to the phone as returned by phoneOpen 
  130.     DWORD      dwDeviceID;            // device ID of the phone device
  131.     DWORD        dwRequestID;
  132.     char       szPhoneName[128]; // the phone's name 
  133. }PHONEINFO;
  134.  
  135. MYINFO myInfo;          //instance of MYINFO structure
  136. PHONEINFO myPhoneInfo[MAX_PHONE];  //instance of myPhoneInfo structure
  137.  
  138. LONG lRet;        //return code
  139. char buf[BUFSIZE];    // buffer for debug message
  140. char DataBuf[BUFSIZE]; //get/set data buffer;
  141.  
  142. DWORD i;
  143. DWORD dwHookSwitchDevs;
  144. DWORD dwLampMode;
  145. DWORD dwRingMode;
  146. DWORD dwRingVolume;
  147. DWORD dwHookSwitchVolume;
  148. DWORD dwPhoneStates;
  149. DWORD dwButtonModes;
  150. DWORD dwButtonStates;
  151. DWORD dwGain;
  152. HICON hIcon;
  153.  
  154. LONG lRet;
  155. char buf[BUFSIZE];
  156.  
  157. PHONECAPS*             pPhoneCaps;
  158. PHONEBUTTONINFO*  pButtonInfo;
  159. VARSTRING*            pVarString;
  160. PHONESTATUS*        pPhoneStatus;
  161. PHONEEXTENSIONID    ext_id;                                             
  162.  
  163.  
  164. LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
  165. {
  166.    switch( uMsg )
  167.    {
  168.       case WM_COMMAND :
  169.          switch( LOWORD( wParam ) )
  170.          {
  171.             case IDM_RUN  :
  172.              //phoneInitialize
  173.                //...............................................
  174.             lRet = phoneInitialize(&myInfo.phoneApp, hInst, phoneCallback, lpszAppName, &myInfo.dwNumDevices);
  175.             if (lRet == 0) 
  176.             {
  177.                 
  178.                wsprintf(buf, "phoneInitialize succeeded!");
  179.                    SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  180.             }
  181.                
  182.                else 
  183.                {
  184.                    wsprintf( buf,"phoneInitialize failed, err=x%lx",lRet);
  185.                SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  186.                     phoneError(lRet);
  187.                     break;
  188.             }                    
  189.                
  190.             //phoneNegotiateAPIVersion
  191.                   //...............................................
  192.             lRet = phoneNegotiateAPIVersion(myInfo.phoneApp, 0, APILOWVERSION, APIHIVERSION, 
  193.                                                     &myInfo.dwAPIVersion, &ext_id);
  194.             if (lRet == 0)                        
  195.             {
  196.                wsprintf(buf, "phoneNegotiateAPIVersion succeeded!");
  197.                       SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  198.             }
  199.                   else 
  200.                   {
  201.                    wsprintf(buf, "phoneNegotiateAPIVersion failed, err=x%lx", lRet);
  202.                     SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  203.                     phoneError(lRet);
  204.                     phoneShutdown(myInfo.phoneApp);
  205.                break;
  206.              }
  207.  
  208.                //phoneNegotiateExtVersion
  209.                //...............................................
  210.             lRet = phoneNegotiateExtVersion(myInfo.phoneApp, 0, myInfo.dwAPIVersion, EXTLOWVERSION, 
  211.                                                 EXTHIVERSION, &myInfo.dwExtVersion);
  212.             if (lRet == 0)                        
  213.             {
  214.                     wsprintf(buf, "phoneNegotiateExtVersion succeeded!");
  215.                SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  216.               }
  217.                   else 
  218.                {
  219.                     wsprintf(buf, "phoneNegotiateExtVersion failed, err=x%lx", lRet);
  220.                       SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  221.                       phoneError(lRet);
  222.                }
  223.  
  224.             
  225.             break;
  226.          
  227.             case IDM_EXIT :
  228.                for (i = 0; i < myInfo.dwNumDevices; i++)
  229.                     phoneClose(myPhoneInfo[i].hPhone);
  230.                 
  231.                    phoneShutdown(myInfo.phoneApp);
  232.                DestroyWindow( hWnd );
  233.                break;
  234.          
  235.             case IDM_ABOUT :
  236.                 DialogBox( hInst, "AboutBox", hWnd, (DLGPROC)About );
  237.                break;
  238.          }
  239.                 
  240.             return( DefWindowProc( hWnd, uMsg, wParam, lParam ) );
  241.  
  242.       
  243.        case WM_CREATE :
  244.  
  245.           hdc = GetDC (hWnd) ;
  246.           GetTextMetrics (hdc, &tm) ;
  247.           ReleaseDC (hWnd, hdc) ;
  248.  
  249.           hListWnd = CreateWindowEx( 0, "listbox", 
  250.                         " ",    
  251.                         WS_CHILD | WS_VISIBLE,  
  252.                         tm.tmAveCharWidth, tm.tmHeight * 3, 
  253.                         tm.tmAveCharWidth * 16 +
  254.                                    GetSystemMetrics (SM_CXVSCROLL), 
  255.                         tm.tmHeight * 5,  
  256.                         hWnd,              
  257.                         NULL,              
  258.                         hInst,         
  259.                         NULL               
  260.                         );
  261.       
  262.           break;
  263.       
  264.       case WM_SIZE:
  265.           MoveWindow(hListWnd,0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
  266.          break;
  267.  
  268.       case WM_DESTROY :
  269.          PostQuitMessage(0);
  270.          break;
  271.             
  272.       default :
  273.             return( DefWindowProc( hWnd, uMsg, wParam, lParam ) );
  274.    }
  275.  
  276.    return( 0L );
  277. }
  278.  
  279.  
  280.  
  281. /****************************************************************************
  282.     FUNCTION: phoneCallback
  283.     PURPOSE:  callback function handles phone events
  284. ****************************************************************************/
  285. LRESULT CALLBACK phoneCallback (DWORD  dwDevice, DWORD dwMsg,
  286.                                 DWORD dwCallbackInst, DWORD dwParam1,
  287.                                 DWORD dwParam2,DWORD dwParam3)
  288. {
  289.     
  290.     switch (dwMsg)
  291.     {
  292.         case PHONE_REPLY:
  293.             if (dwParam1 == myPhoneInfo[OWNER].dwRequestID) 
  294.                    if (dwParam2 != 0)
  295.                 {
  296.                        wsprintf( buf,"Function failed, err=x%lx", lRet);
  297.                        phoneError(lRet);
  298.                        SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  299.                    }
  300.             break;       
  301.  
  302.         case PHONE_STATE:
  303.         
  304.             if (dwParam1 == PHONESTATE_RINGMODE)
  305.             {
  306.                 lRet = phoneGetRing(myPhoneInfo[OWNER].hPhone, &dwRingMode, &dwRingVolume);
  307.                 if (lRet == 0)
  308.                {
  309.                 wsprintf(buf, "phoneGetRing succeeded!");
  310.                    SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  311.                if (dwRingMode == 0)
  312.                     {
  313.                         wsprintf(buf, "The phone device is currently not ringing.");
  314.                         SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  315.                }
  316.                     else
  317.                     {
  318.                         wsprintf(buf, "The phone is ringing with a Ring Mode pattern of x%lx", dwRingMode);
  319.                         SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  320.                    wsprintf(buf, "The phnes's Ring Volume is x%lx", dwRingVolume);
  321.                         SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  322.                     }
  323.                }
  324.                  else 
  325.                {
  326.                     wsprintf( buf,"phoneGetRing failed, err=x%lx", lRet);
  327.                    phoneError(lRet);
  328.                }        
  329.               
  330.               break;
  331.               }
  332.             
  333.  
  334.             if (dwParam1 == PHONESTATE_SPEAKERHOOKSWITCH)
  335.             {   
  336.                 lRet = phoneGetHookSwitch(myPhoneInfo[OWNER].hPhone, &dwHookSwitchDevs);
  337.                 if (lRet == 0)
  338.                {
  339.                wsprintf(buf, "phoneGetHookSwitch succeeded!");
  340.                       SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  341.                
  342.                if (dwHookSwitchDevs & PHONEHOOKSWITCHDEV_SPEAKER)
  343.                     {
  344.                         wsprintf(buf, "The phone's HookSwitch Speaker is offhook!");
  345.                        SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  346.                     }
  347.                     else
  348.                     {
  349.                    wsprintf(buf, "The phone's HookSwitch Speaker is onhook!");
  350.                         SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  351.                     }
  352.  
  353.               }
  354.                  else 
  355.                {
  356.                       wsprintf( buf,"phoneGetHookSwitch failed, err=x%lx", lRet);
  357.                    phoneError(lRet);
  358.                }    
  359.             break;                
  360.             }
  361.  
  362.             if (dwParam1 == PHONESTATE_SPEAKERVOLUME)
  363.             {   
  364.                 lRet = phoneGetVolume(myPhoneInfo[OWNER].hPhone, PHONEHOOKSWITCHDEV_SPEAKER, &dwHookSwitchVolume);
  365.                if (lRet == 0)
  366.                {
  367.                 wsprintf(buf, "phoneGetVolume succeeded!");
  368.                    SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  369.                wsprintf(buf, "The current volume for the Speaker Hookswitch is x%lx", dwHookSwitchVolume);
  370.                     SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  371.                }
  372.                  else 
  373.                {
  374.                     wsprintf( buf,"phoneGetVolume failed, err=x%lx", lRet);
  375.                    phoneError(lRet);
  376.                }    
  377.             break;                
  378.             }
  379.  
  380.             if (dwParam1 == PHONESTATE_SPEAKERGAIN)
  381.             {   
  382.                 lRet = phoneGetGain(myPhoneInfo[OWNER].hPhone, PHONEHOOKSWITCHDEV_SPEAKER, &dwGain);
  383.                 if (lRet == 0)
  384.                {
  385.                   wsprintf(buf, "phoneGetGain succeeded!");
  386.                       SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  387.                     wsprintf(buf, "The current Gain is x%lx", dwGain);
  388.                     SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  389.                }
  390.                  else 
  391.                {
  392.                       wsprintf( buf,"phoneGetGain failed, err=x%lx", lRet);
  393.                     phoneError(lRet);
  394.                }
  395.             break;                
  396.             }
  397.             
  398.             if (dwParam1 == PHONESTATE_DISPLAY)
  399.             {   
  400.                 pVarString = (VARSTRING *) calloc (1, sizeof(VARSTRING)+1000);
  401.                 pVarString->dwTotalSize = sizeof(VARSTRING) + 1000;
  402.                 lRet = phoneGetDisplay(myPhoneInfo[OWNER].hPhone, pVarString);
  403.                 if (lRet == 0)
  404.                {
  405.                   wsprintf(buf, "phoneGetDisplay succeeded!");
  406.                       SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  407.                strcpy(buf, lpszTitle);
  408.                //strcpy(buf, ((LPSTR)(pVarString)+pVarString->dwStringOffset));
  409.                strcat( buf, " is the current phone display." );
  410.                SendMessage(hListWnd, LB_INSERTSTRING, (WPARAM) -1, (LONG) (LPSTR) buf) ;
  411.                }
  412.                  else 
  413.                {
  414.                    wsprintf( buf,"phoneGetDisplay failed, err=x%lx", lRet);
  415.                   phoneError(lRet);
  416.                }    
  417.                     
  418.                 free (pVarString);
  419.                 break;
  420.               }
  421.    }
  422.    return (TRUE);
  423.  
  424.  
  425. /****************************************************************************
  426.     FUNCTION: phoneError
  427.     PURPOSE:  phone error messages
  428. ****************************************************************************/
  429. void phoneError (LONG lrc)
  430. {
  431.  switch (lrc) {
  432.     case PHONEERR_INVALAPPHANDLE:
  433.        MessageBox (hWnd, "Invalid app handle.", "", MB_OK);
  434.        break;
  435.     case PHONEERR_BADDEVICEID:
  436.        MessageBox (hWnd,"The specified phone device ID is out of range.", "", 
  437.                    MB_OK);
  438.        break;
  439.     case PHONEERR_INCOMPATIBLEAPIVERSION:
  440.        MessageBox (hWnd, "Incompatible API version.", "", MB_OK);
  441.        break;
  442.     
  443.     case PHONEERR_INVALBUTTONLAMPID:
  444.        MessageBox (hWnd, "Invalid Button Lamp ID.", "", MB_OK);
  445.        break;
  446.  
  447.     case PHONEERR_INVALBUTTONMODE:
  448.        MessageBox (hWnd, "Invalid Button Mode.", "", MB_OK);
  449.        break;
  450.  
  451.     case PHONEERR_INVALBUTTONSTATE:
  452.        MessageBox (hWnd, "Invalid Button State", "", MB_OK);
  453.        break;
  454.  
  455.     case PHONEERR_INUSE:
  456.        MessageBox (hWnd, "Phone in Use.", "", MB_OK);
  457.        break;
  458.     
  459.     case PHONEERR_INVALHOOKSWITCHDEV:
  460.        MessageBox (hWnd, "Invalid Hookswitch Device.", "", MB_OK);
  461.        break;
  462.  
  463.     case PHONEERR_INVALHOOKSWITCHMODE:
  464.        MessageBox (hWnd, "Invalid Hookswitch Device Mode.", "", MB_OK);
  465.        break;
  466.  
  467.     case PHONEERR_INVALLAMPMODE:
  468.        MessageBox (hWnd, "Invalid Lamp Mode.", "", MB_OK);
  469.        break;
  470.      
  471.     case PHONEERR_INCOMPATIBLEEXTVERSION:
  472.        MessageBox (hWnd, "Incompatible extension version.","", MB_OK);
  473.        break;
  474.     case PHONEERR_NOMEM:
  475.        MessageBox (hWnd, "No memory","", MB_OK);
  476.        break;
  477.     case PHONEERR_NODRIVER:
  478.        MessageBox (hWnd, "No driver loaded", "", MB_OK);
  479.        break;
  480.     case PHONEERR_RESOURCEUNAVAIL:
  481.        MessageBox (hWnd, "Resource overcommittment", "", MB_OK);
  482.        break;
  483.     case PHONEERR_ALLOCATED:
  484.        MessageBox (hWnd, "Allocation error", "", MB_OK);
  485.        break;
  486.     case PHONEERR_INVALDATAID:
  487.        MessageBox (hWnd, "The data ID is out of range.", "", MB_OK);
  488.        break;
  489.     case PHONEERR_INVALDEVICECLASS:
  490.        MessageBox (hWnd, "The device class was invalid.", "", MB_OK);
  491.        break;
  492.     case PHONEERR_INVALPOINTER:
  493.        MessageBox (hWnd, "The specified pointer parameter is invalid.",
  494.                    "", MB_OK);
  495.        break;
  496.     case PHONEERR_OPERATIONFAILED:
  497.        MessageBox (hWnd, "Operation failed.", "", MB_OK);
  498.        break;
  499.     case PHONEERR_INVALPHONEHANDLE:
  500.        MessageBox (hWnd, "Invalid phone handle", "", MB_OK);
  501.        break;
  502.     case PHONEERR_INVALPHONESTATE :
  503.        MessageBox (hWnd, "Invalid call state for this function.", "", MB_OK);
  504.        break;
  505.     case PHONEERR_INVALPRIVILEGE:
  506.        MessageBox (hWnd, "Invalid privilege for this function.", "", MB_OK);
  507.        break;
  508.     case PHONEERR_NODEVICE:
  509.        MessageBox (hWnd, "No associated device for given class",
  510.                    "", MB_OK);
  511.        break;
  512.     case PHONEERR_OPERATIONUNAVAIL:
  513.        MessageBox (hWnd, "The operation is unavailable",
  514.                    "", MB_OK);
  515.        break;
  516.     case PHONEERR_INVALPARAM:
  517.         MessageBox(hWnd, "Invalid Paramater", "", MB_OK);
  518.        break; 
  519.  
  520.     case PHONEERR_INVALRINGMODE:
  521.             MessageBox(hWnd, "Invalid Ring Mode", "", MB_OK);
  522.        break; 
  523.  
  524.     }
  525.     
  526.              
  527. }
  528.  
  529. LRESULT CALLBACK About( HWND hDlg,           
  530.                         UINT message,        
  531.                         WPARAM wParam,       
  532.                         LPARAM lParam)
  533. {
  534.    switch (message) 
  535.    {
  536.        case WM_INITDIALOG: 
  537.                return (TRUE);
  538.  
  539.        case WM_COMMAND:                              
  540.                if (   LOWORD(wParam) == IDOK         
  541.                    || LOWORD(wParam) == IDCANCEL)    
  542.                {
  543.                        EndDialog(hDlg, TRUE);        
  544.                        return (TRUE);
  545.                }
  546.                break;
  547.    }
  548.  
  549.    return (FALSE); 
  550. }
  551.  
  552.  
  553.  
  554.  
  555.  
  556.